/**
 * @Author: boyyang
 * @Date: 2022-01-31 18:12:21
 * @LastEditTime: 2022-02-09 09:14:10
 * @LastEditors: boyyang
 * @Description: 
 * @FilePath: \boyyang\functions\clearThumbUp\index.js
 */

const cloudbase = require("@cloudbase/node-sdk")
const app = cloudbase.init({
    env: 'boyyang-8gv2s8f21447c0c6'
})

const db = app.database()
const _ = db.command
exports.main = async (event, context) => {

    let response = {
        msg: '点赞已经更新'
    }


    await db.collection('usersBlog').where(
        {thumb: _.gt(0)}
    ).update({
        thumbArray: []
    })

    await db.collection('wallpaper_mobile').where(
        {thumb: _.gt(0)}
    ).update({
        thumbArray: []
    })

    await db.collection('wallpaper_pc').where(
        {thumb: _.gt(0)}
    ).update({
        thumbArray: []
    })


    return response
}

